package com.jyh.homework;

import java.util.InputMismatchException;
import java.util.Scanner;

public class TestNum {
    public static void main(String[] args) throws Exception {
        Scanner input = new Scanner(System.in);
        System.out.print("请输入数字：");
            int num = input.nextInt();
            if (num < 0 || num > 100) {
                throw new Exception("分数必须在0—100之间！");
            }
            else {
                System.out.println(num);
            }
    }
}
